const path = require('path')
    // 定义文件的存放路径
const fpath = '/a/b/c/index.html'
    // 获取文件名
const fullName = path.basename(fpath)
console.log(fullName); //index.html

// 移除文件扩展名 basename
const nameWithoutExt = path.basename(fpath, '.html')
console.log(nameWithoutExt);